import request from '@/utils/request'
// 获取员工列表
export function sysUser(params) {
  return request({
    url: '/sys/user',
    params
  })
}
// 新增员工列表
export function sysUserPost(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工
export function sysUserDel(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'delete'
  })
}
// 批量导入员工
export function sysUserBatch(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 获取员工个人信息
export function employeesPersonalInfo(id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
// 员工个人信息更新
export function employeesPersonalInfoPut(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取员工岗位信息
export function employeesJobs(id) {
  return request({
    url: `/employees/${id}/jobs`
  })
}
// 保存员工岗位信息
export function employeesJobsPut(data) {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
// 获取员工转正信息
export function employeesPositive(id) {
  return request({
    url: `/employees/${id}/positive`
  })
}
// 保存员工转正信息
export function employeesPositivePut(data) {
  return request({
    url: `/employees/${data.userId}/positive`,
    method: 'put',
    data
  })
}
// 查询员工调岗信息
export function employeesTransferPosition(id) {
  return request({
    url: `/employees/${id}/transferPosition`
  })
}
// 给角色分配权限
export function sysUserAssignRoles(id, roleIds) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: {
      id,
      roleIds
    }
  })
}
